import type { EnergyPriceQueryHistoryListParams } from '@/types'

export const defaultHistoryPagingParams: EnergyPriceQueryHistoryListParams
  = {
    id: 0,
    startTime: formatTime(
      Date.now() - 1000 * 60 * 60 * 24 * 30,
      'YYYY-MM-DD',
    ),
    endTime: formatTime(
      Date.now() + 1000 * 60 * 60 * 24,
      'YYYY-MM-DD',
    ),
  }

export const chartOption = {
  series: [
    {
      step: 'end',
      label: {
        show: true,
        formatter(params: any) {
          params.data[1] = (
            Math.round(params.data[1] * 100) / 100
          ).toFixed(2)
          // return `${params.data.join(':')}元`;
          return `${params.data[1]}千元`
        },
        offset: [-16, -10],
        position: 'insideTopRight ',
        verticalAlign: 'middle',
        overflow: 'breakAll',
      },
    },
  ],
}
